package com.um.jdy.platform.shop.manager;

import com.um.jdy.common.shop.service.OrderCommentService;
import com.um.jdy.common.shop.entity.po.OrderComment;
import com.um.jdy.common.shop.entity.dto.OrderCommentDTO;
import com.um.jdy.common.shop.entity.vo.OrderCommentVO;
import com.um.jdy.platform.shop.entity.dto.OrderCommentPageDTO;
import com.um.jdy.platform.shop.entity.vo.OrderCommentItemVO;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.manager.BasePlusManager;
import com.um.springboot.starter.orm.params.ListDTO;
import com.um.springboot.starter.orm.params.PageDTO;
import com.um.springboot.starter.orm.params.PageParams;
import org.springframework.stereotype.Component;

/**
 * 管理类：订单评论表
 */
@Component
public class OrderCommentManager extends BasePlusManager<OrderCommentService,OrderComment,OrderCommentDTO,OrderCommentVO, PageDTO, ListDTO> {

    public Page<OrderCommentItemVO> getPage(OrderCommentPageDTO params) {
        PageParams pageParams = params.toPageParams();
        pageParams.getCondition().put("t.com_id",getComId());

        Page<OrderCommentItemVO> page = new Page<>();

        page.setPageSize(params.getPageSize());
        page.setPageNo(params.getPageNo());

        page = service.getCMSViewModelPageBySqlName(page,"get_order_comment_page", "get_order_comment_count", OrderCommentItemVO.class, pageParams.getProperties(), pageParams.getValues(), pageParams.getRangeEntitys(),pageParams.getOrderNames(),pageParams.getSortOns());
        return page;
    }
}
